$('button').click(function(){
    let name=$('[name="name"]').val();
    let pwd=$('[name="pwd"]').val();
    // console.log(name,pwd);
    const p=myPromiseJQueryAjax("../server/goods_login.php","post",{userName:name,userPwd:pwd},"json");
    p.then(function(res){
        // console.log(res);
        if(res.result===1){
            mySetCookie("login",1,7*24*60*60,"/");
            window.confirm("恭喜您登陆成功，点击确定哪里来的跳转到哪里去");
            window.location.href=`${window.location.search.substr(5)}`;
            // window.location.href="./index.html";
        }else if(res.result===0){
            window.alert("登陆失败，请重新检查账号密码");
        }
    })
})